package com.boatAnchorAssistant.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.TableComment;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.Data;
import nirvana.core.domains.ann.AccEntity;
import nirvana.core.domains.entity.DomainBaseEntity;
import nirvana.core.domains.enums.EntityType;

import javax.persistence.Table;

/**
 * 【描 述】：
 * 【环 境】：J2SE 17
 * 【详 细】：
 *
 * @author 李松林
 * @version v1.0 2024/4/29 新建
 * @since 2024/4/29
 */
@Data
@Table
@AccEntity(value = "部门",type = EntityType.SERVICE_ENTITY)
@TableComment("部门")
public class Department extends DomainBaseEntity<Department> {


    /**
     * 企业id
     */
    @Column(type = MySqlTypeConstant.BIGINT,
            length = 20,
            comment = "企业id",
            isNull = false)
    private Long tenantId;

    /**
     * 名称
     */
    @Column(type = MySqlTypeConstant.VARCHAR,
            length = 20,
            comment = "名称",
            isNull = false)
    private String name;


    /**
     * 等级 0级为公司
     */
    @Column(type = MySqlTypeConstant.INT,
            length = 11,
            comment = "等级",
            isNull = false)
    @TableField("`level`")
    private Integer level;


    /**
     * 职能
     */
    @Column(type = MySqlTypeConstant.VARCHAR,
            comment = "职能",
            isNull = false,
            defaultValue = "")
    @TableField("`function`")
    private String function;

    /**
     * 备注
     */
    @Column(type = MySqlTypeConstant.VARCHAR,
            comment = "备注",
            isNull = false,
            defaultValue = "")
    private String remark;

    /**
     * 上级id
     */
    @Column(type = MySqlTypeConstant.BIGINT,
            length = 20,
            comment = "上级id",
            isNull = false,
            defaultValue = "1")
    private Long parentId;

}
